import React from 'react';
import { connect } from 'dva';
import { Icon } from 'antd-mobile';
import { routerRedux } from 'dva/router';
import content from '../../../components/common/contentCss/content.css';
import CustTitle from '../../../components/common/title/title';
import styles from './common.css';
import TxMap from './pages/txMap';

function Index({ dispatch, loading,txMap }) {

  const {companyName,latitude,longitude} = txMap;

  const titleProps = {
    titleName:'地图',
    goBack(){
      dispatch(routerRedux.goBack());
    },
  }

  const txMapProps = {
    companyName,
    latitude,
    longitude
  }

  return (
    <div className={content.content}>

      {/* <CustTitle {...titleProps}/> */}

     <div className={styles.mapBody}>
      <TxMap {...txMapProps}/>
     </div>

    </div>
  )
}

function mapStateToProps(state, ownProps) {
  return {
    loading: state.loading.global,
    txMap: state.txMap,
  }
}

export default connect(mapStateToProps)(Index);
